package com.baizhi.feign;

import com.baizhi.entity.Result;
import com.baizhi.pojo.Count;
import com.baizhi.pojo.Goods;
import com.baizhi.entity.PageResult;
import com.baizhi.entity.QueryPageBean;
import com.baizhi.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("baizhi-goods-service")
public interface GoodsServiceFeign {

/*
    *//**
     * 查询分页
     * @param page
     * @param rows
     * @return
     *//*
    @RequestMapping("selectGoodsByPage")
    public PageResult selectGoodsByPage(@RequestParam Integer page, @RequestParam Integer rows);


    *//**
     * 添加
     * @param goods
     * @return
     *//*
    @RequestMapping("insertGoods")
    public Integer insertGoods(@RequestBody Goods goods);

    *//**
     * 删除
     * @param id
     * @return
     *//*
    @RequestMapping("deleteGoodsById")
    public Integer deleteGoodsById(@RequestParam Long id);*/

    /**
     * 分页查询
     * @param queryPageBean
     * @return
     */
    @RequestMapping("/findPage")
    public PageResult findPage(@RequestBody QueryPageBean queryPageBean);

    /**
     * 添加
     * @param goods
     * @return
     */
    @RequestMapping("/insertGoods")
    public void insertGoods(@RequestBody Goods goods);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    @RequestMapping("findById")
    public Goods findById(@RequestParam Long id);

    /**
     * 修改
     * @param goods
     * @return
     */
    @RequestMapping("/edit")
    public Integer edit(@RequestBody Goods goods);

    /**
     * 删除
     * @param id
     * @return
     */
    @RequestMapping("delete")
    public Integer delete(@RequestParam Long id);

    /**
     * 登录
     * @param user
     * @return
     */
    @RequestMapping("login")
    public User login(@RequestBody User user);

    /**
     * 修改状态
     * @param id
     * @param status
     * @return
     */
    @RequestMapping("editStatus")
    public Integer editStatus(@RequestParam Long id,@RequestParam Integer status);

    /**
     * 状态因为
     * @param id
     * @param status
     * @param b
     * @return
     */
    @RequestMapping("/updateStatusAndBecause")
    public Integer updateStatusAndBecause(@RequestParam Integer id,@RequestParam Integer status,@RequestParam String b);

    /**
     * 统计图
     * @return
     */
    @RequestMapping("/count")
    public List<Count> count();
}
